package response

import "errors"

const SUCCESS string = "200"
const SERVER_ERROR string = "1000"
const USER_REGISTER_ERR string = "1001"
const USER_LOGIN_ERR string = "1002"

var CodeMap = map[string]string{
	SUCCESS:           "请求成功",
	SERVER_ERROR:      "请求失败,服务器错误",
	USER_REGISTER_ERR: "请求失败,用户注册失败",
	USER_LOGIN_ERR:    "请求失败,用户登陆失败",
}

func GetMsgByCode(code string) (string, error) {
	if val, ok := CodeMap[code]; ok {
		return val, nil
	}
	return "", errors.New("not found code")
}
